import http from "@/api";

import { ResPage } from "@/api/interface";
import { OptionVo } from "@/biz/interface";

import { JobTagEntity, JobTagVo } from "@/biz/interface/JobType";

import { ModuleMainUrl } from "..";

const moduleUrl = ModuleMainUrl;

// * 获取一级类型，
export const getJobTagsL1DropApi = (params: {}) => {
  return http.post<ResPage<OptionVo>>(moduleUrl + `/job/tp1drop`, params);
};

// * 获取二级类型，传参数pid= 一级菜单,表格页面接口， 带分页
export const getJobTagsVoListApi = (params: {}) => {
  return http.post<ResPage<JobTagVo>>(moduleUrl + `/job/tagvolist`, params);
};

// * 获取二级类型，传参数pid= 一级菜单,表格页面接口， 带分页
export const getJobTagsByTypeVoListApi = (params: { type: number }) => {
  return http.post<ResPage<JobTagVo>>(moduleUrl + `/job/tagvolist`, params);
};

// * 获取岗位福利标签
export const getJobTagDropsByTypeVoListApi = (params: { type: number }) => {
  return http.post<ResPage<JobTagVo>>(moduleUrl + `/job/tagdrops`, params);
};

// * 获取二级类型， 传参数pid= 一级菜单
export const getJobTagsL2DropApi = (params: {}) => {
  return http.post<ResPage<OptionVo>>(moduleUrl + `/job/tp2drop`, params);
};

// * 新增招工标签接口
export const saveJobTagsApi = (jobTags: JobTagEntity) => {
  return http.post(moduleUrl + `/job/tagsave`, jobTags);
};

// * 详情招工标签接口
export const getJobTagsInfoApi = (params: { id: string }) => {
  return http.post<JobTagEntity>(moduleUrl + `/job/taginfo`, params);
};

// * 删除招工标签接口
export const deleteJobTagsApi = (params: { id: string }) => {
  return http.post(moduleUrl + `/job/tagdelete`, params);
};

// * 修改招工标签状态接口
export const changeFlagActiveApi = (params: { id: string }) => {
  return http.post(moduleUrl + `/job/tagactive`, params);
};
